package com.cuitrip.business.setting;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.cuitrip.service.R;
import com.lab.app.BaseActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created on 7/16.
 */
public class SubmitSuccessActivity extends BaseActivity {


    @Bind(R.id.main_title)
    TextView mainTitle;

    @Bind(R.id.content)
    TextView content;

    @Bind(R.id.submit_action)
    TextView submitAction;

    public static final String TITLE_KEY = "title_key";
    public static final String CONTENT_KEY = "content_key";

    public static void startActivity(Context context, String title, String content){
        Intent intent = new Intent(context, SubmitSuccessActivity.class);
        intent.putExtra(TITLE_KEY, title);
        intent.putExtra(CONTENT_KEY, content);
        context.startActivity(intent);
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.submit_success);
        ButterKnife.bind(this);
        initData();
    }

    private void initData() {
        if (getIntent().hasExtra(CONTENT_KEY)){
            content.setText(getIntent().getStringExtra(CONTENT_KEY));
        }else{
            content.setVisibility(View.GONE);
        }
        if (getIntent().hasExtra(TITLE_KEY)){
            mainTitle.setText(getIntent().getStringExtra(TITLE_KEY));
        }else{
            mainTitle.setVisibility(View.GONE);
        }
    }

    @OnClick(R.id.submit_action)
    protected void submitConfirm() {
        finish();
    }


}
